import defaultData, { dftWaterMark } from "./data";
import Props from "../base/Props";
import { WeaInput, WeaCheckbox, WeaLocaleProvider } from 'ecCom';
import { Row, Col } from "antd";
import { isChecked } from '../../../../../utils/statusDetect';

const getLabel = WeaLocaleProvider.getLabel;

export default class SingnatureProps extends Props {
  _renderVerifyContent() {
    const { watermark = dftWaterMark } = this.props.data;
    
    return (
      <React.Fragment ecId={`${this && this.props && this.props.ecId || ''}_Fragment@wfb70r`}>
        <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@zieszc`} style={ isChecked(watermark.enabled) ? { lineHeight:"40px" } : {}}>
           <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@3m7cx2`} span={8}>
            <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@gp16ti`}
              content={getLabel('527693','添加水印')}
              value={watermark.enabled}
              onChange={this.handlePropChange('watermark.enabled')}
            />
          </Col>
          {
            isChecked(watermark.enabled) ? (
              <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@219fju`} span={16}>
                <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@unxoem`}
                  value = { watermark.content }
                  onChange = { this.handlePropChange('watermark.content') }
                  placeholder = { getLabel('517430', '请输入水印内容文本') }
                />
              </Col>
            ) : null
          }
        </Row>
      </React.Fragment>
    )
  }
}

SingnatureProps.defaultProps = {
  data: defaultData
};